package parts3.lesson31;

import java.util.concurrent.ExecutionException;
import java.util.concurrent.FutureTask;

public class Demo {
    public static void main(String[] args) throws ExecutionException, InterruptedException {
        FutureTask<String> task = new FutureTask<String>(new MyThread("线程跑起来"));
        Thread thread = new Thread(task);
        thread.start();
        String msg = task.get();
        System.out.println("返回的消息结果：" + msg);
    }
}
